package main

import (
	"context"
	"fmt"
	"gitee.com/DonHz/electronic-business-systems/mxshop_srvs/goods_srv/proto"
)

func TestBrandList() {
	// 客户端
	resp, err := brandClient.BrandList(context.Background(), &proto.BrandFilterRequest{})
	if err != nil {
		panic(err)
	}
	fmt.Println("resp.total: ", resp.Total)
	for _, brand := range resp.Data {
		fmt.Println(brand.Name)
	}
}

func TestCreateBrand() {
	resp, err := brandClient.CreateBrand(context.Background(), &proto.BrandRequest{
		Name: "DW",
		Logo: "https://media1.thehungryjpeg.com/thumbs2/ori_3684605_5pck9af1rpfgnlcq9634g5j7zk4knf064mhm9zu5_dw-monogram-logo-design.jpg",
	})
	if err != nil {
		panic(err)
	}
	fmt.Println(resp.Id)
}

func TestDeleteBrand() {
	brandClient.DeleteBrand(context.Background(), &proto.BrandRequest{
		Name: "DW",
	})
}
